package com.lry.thread;

import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

public class BrokerThreadFactory {


    public static ThreadFactory factory = new ThreadFactory() {

        AtomicInteger atomic = new AtomicInteger(1);
        @Override
        public Thread newThread(Runnable r) {
            Thread thread = new Thread(r,"MyThread--"+atomic.getAndIncrement());
            return thread;
        }

    };





}
